﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MiniDuckSimulator
{
    public abstract class Duck
    {
        public IFlyBehavior flyBehavior;
        public IQuackBehavior quackBehavior;
        public void PerformQuack()
        {
            quackBehavior.quack();
        }
        public void PerformFly()
        {
            flyBehavior.fly();
        }

        public abstract void Display();
        public void Swim() {
            Console.WriteLine("All ducks can swim");
        }

        public void SetFlyBehavior(IFlyBehavior ifb) {
            flyBehavior = ifb;
        }
        public void SetQuackBehavior(IQuackBehavior iqb) {
            quackBehavior = iqb;
        }
    }
}
